﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using System.Diagnostics;
using System.IO;
namespace LitTools
{
    /// <summary>
    /// 自定义文件存档工具
    /// </summary>
    public class CustomFileSaveTools
    {
        [MenuItem("LitTools/LitSave/CustomFileSave/打开存档路径")]
        public static void OpenFilePath()
        {
            Process.Start(new ProcessStartInfo() { FileName = Application.persistentDataPath });
        }

        [MenuItem("LitTools/LitSave/CustomFileSave/清理所有数据")]
        public static void ClearAllData()
        {
            string filePath = Application.persistentDataPath + "/saveData.veer";
            if (File.Exists(filePath))
            {
                if (EditorUtility.DisplayDialog("LitSave", "存档文件删除后无法还原！", "ok"))
                {
                    File.Delete(filePath);
                }
            }
            else
                EditorUtility.DisplayDialog("LitSave", "没有存档文件", "ok");
        }
    }
}